package com.hdax.easybuy.controller;



import com.hdax.easybuy.dao.UserDao;
import com.hdax.easybuy.entity.User;
import com.hdax.easybuy.entity.Users;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
@ResponseBody
@RequestMapping(value = "/providerUser")
public class UserProviderController {



    @Resource
    private UserDao userDao;

    @RequestMapping("/queryAll")
    public List<User> queryAll(){

        return userDao.findAll();
    }
    @RequestMapping("/test")
    public List<User> test(){

        return userDao.findAll();
    }

    @RequestMapping("/getUserByuNameAndPwd/{userName}/{password}")
    public User getUserByuNameAndPwd(@PathVariable("userName") String userName,
                                     @PathVariable("password") String password){

        return userDao.findUserByLoginNameAndPassword(userName,password);
    }



}
